package org.liquidByte.simpleChat.communication;

import java.io.IOException;

public abstract class AbstractClient {
	private Channel channel;
	
	protected AbstractClient(Channel channel) {
		if (channel == null) {
			throw new NullPointerException("channel is null");
		}
		this.channel = channel;
	}

	public Channel getChannel() {
		return channel;
	}
	
	protected Object call(Object operation, Object... params) throws IOException, CommunicationException {
		return this.getChannel().call(new ChannelCall(operation, params));
	}
}
